/**
 * 
 */
package pt.inescid.components.console.commands;

import pt.inescid.components.console.Console;

/**
 * @author Sergio Esteves (sesteves at gsd.inesc-id.pt)
 *
 */
public class SetRatioCommand extends Command {

	public static final String CMD_NAME = "set_ratio";

	public SetRatioCommand(Console console) {
		super(console);
	}

	@Override
	public void execute(String[] args) throws CommandException {
		this.validateArgs(args, 2, 2);
		gridP2P.setRatio(Double.parseDouble(args[1]));
	}

	@Override
	public String getCmdName() {
		return CMD_NAME;
	}

	@Override
	public String synopsis() {
		return CMD_NAME + " ratio" + SYNTAX_SEPARATOR +
			"Sets the ratio for this node";
	}
}
